package com.heima.api.wemedia;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.model.wemedia.dtos.AdminNewsPageReqDto;
import com.heima.model.wemedia.dtos.WmChannelDto;
import com.heima.model.wemedia.dtos.WmSensitiveDto;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "leadnews-wemedia")
public interface IWmChannelClient {

    @ApiOperation("根据id删除频道")
    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult delById(@PathVariable Integer id);

    @ApiOperation("频道名称模糊分页查询")
    @PostMapping("/api/v1/channel/list")
    ResponseResult listPage(@RequestBody WmChannelDto wmChannel);

    @ApiOperation("保存频道")
    @PostMapping("/api/v1/channel/save")
    ResponseResult saveChannel(@RequestBody WmChannel wmChannel);

    @ApiOperation("修改频道")
    @PostMapping("/api/v1/channel/update")
    ResponseResult updateChannel(@RequestBody WmChannel wmChannel);

    @ApiOperation("删除敏感词")
    @DeleteMapping("/api/v1/sensitive/del/{id}")
    ResponseResult deletaById(@PathVariable("id") Integer id);

    @ApiOperation("查询敏感词")
    @PostMapping("/api/v1/sensitive/list")
    ResponseResult list(@RequestBody WmSensitiveDto dto);

    @ApiOperation("保存敏感词")
    @PostMapping("/api/v1/sensitive/save")
    ResponseResult save(@RequestBody WmSensitive sensitive);

    @ApiOperation("修改敏感词")
    @PostMapping("/api/v1/sensitive/update")
    ResponseResult update(@RequestBody WmSensitive sensitive);

    @PostMapping("/api/v1/auth/save")
    void saveUser(@RequestBody ApUser apUser);

    @ApiOperation("查询文章列表")
    @PostMapping("/api/v1/news/list_vo")
    ResponseResult list_vo(@RequestBody AdminNewsPageReqDto dto);

    @ApiOperation("查看文章详情")
    @GetMapping("/api/v1/news/one_vo/{id}")
    ResponseResult one_vo(@PathVariable("id") Integer id);

    @ApiOperation("审核失败")
    @PostMapping("/api/v1/news/auth_fail")
    ResponseResult auth_fail(@RequestBody AdminNewsPageReqDto newsDto);

    @ApiOperation("审核通过")
    @PostMapping("/news/auth_pass")
    public ResponseResult auth_pass(@RequestBody AdminNewsPageReqDto newsDto);

}
